package com.olc.view;import android.content.Context;import android.support.v4.view.ViewPager;import android.util.AttributeSet;import android.view.MotionEvent;public class ViewPagerSlide extends ViewPager {    //Is it possible to slide?    private boolean isSlide = true;    public void setSlide(boolean slide) {        isSlide = slide;    }    public ViewPagerSlide(Context context) {        super(context);    }    public ViewPagerSlide(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    public boolean onInterceptTouchEvent(MotionEvent ev) {        return isSlide && super.onInterceptTouchEvent(ev);    }    @Override    public boolean onTouchEvent(MotionEvent ev) {        return isSlide && super.onTouchEvent(ev);    }    @Override    public void setOffscreenPageLimit(int limit) {        super.setOffscreenPageLimit(limit);    }}